//
//  AboutUsViewController.m
//  FingerUniversity
//
//  Created by vantle on 16/3/12.
//  Copyright © 2016年 vantle. All rights reserved.
//

#import "AboutUsViewController.h"
#import "UIColor+hexColor.h"
#import "MobClick.h"
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
@interface AboutUsViewController ()

@end

@implementation AboutUsViewController
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
    [MobClick beginLogPageView:@"AboutUsViewController"];//("PageOne"为页面名称，可自定义)
}
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [MobClick endLogPageView:@"AboutUsViewController"];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor=[UIColor whiteColor];
    UIImageView*bg=[[UIImageView alloc]initWithFrame:CGRectMake(0, 64, ScreenWidth, ScreenHeight-64)];
    bg.image=[UIImage imageNamed:@"blurred_lines"];
    [self.view addSubview:bg];
    
    UIImageView*barImage=[[UIImageView alloc]initWithFrame:CGRectMake(0, 20, ScreenWidth, 44)];
    barImage.userInteractionEnabled=YES;
    barImage.backgroundColor=[UIColor colorWithRed:0.92 green:0.92 blue:0.92 alpha:1];
    [self.view addSubview:barImage];
    
    UIButton*backButton=[UIButton buttonWithType:UIButtonTypeCustom];
    backButton.frame=CGRectMake(0, 0, 100, 44);
    [backButton addTarget:self action:@selector(backButtonClick) forControlEvents:UIControlEventTouchUpInside];
    [barImage addSubview:backButton];
    
    UIImageView*backImage=[[UIImageView alloc]initWithFrame:CGRectMake(5, 12, 5, 20)];
    backImage.image=[UIImage imageNamed:@"back_arrowleft"];
    [barImage addSubview:backImage];
    
    UIImageView*logoImage=[[UIImageView alloc]initWithFrame:CGRectMake(backImage.frame.origin.x+backImage.frame.size.width+3, 6, 32, 32)];
    logoImage.layer.cornerRadius=3;
    logoImage.clipsToBounds=YES;
    logoImage.image=[UIImage imageNamed:@"app-logo-80"];
    [barImage addSubview:logoImage];
    
    UILabel*noticeLabel=[[UILabel alloc]initWithFrame:CGRectMake(logoImage.frame.origin.x+logoImage.frame.size.width+5, 10, 100, 25)];
    noticeLabel.text=@"拇指校园";
    [barImage addSubview:noticeLabel];
    
    UIImageView*z5linkImage=[[UIImageView alloc]init];
    z5linkImage.image=[UIImage imageNamed:@"logo3"];
    z5linkImage.center=CGPointMake(ScreenWidth/2, 200);
    z5linkImage.bounds=CGRectMake(0, 0, 60, 60);
    [self.view addSubview:z5linkImage];
    
    
    for (int i=0; i<4; i++) {
        UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(30, ScreenHeight-200+35*i, ScreenWidth, 15)];
        label.font=[UIFont systemFontOfSize:16];
        if (i==0) {
            label.text=[NSString stringWithFormat:@"当前版本号：1.0.0"];
        }
        else if (i==1)
        {
            label.text=@"联系电话：0591-85785366";
            CGSize detailSize =[label.text sizeWithFont:[UIFont systemFontOfSize:16] constrainedToSize:CGSizeMake(MAXFLOAT, MAXFLOAT) lineBreakMode:UILineBreakModeWordWrap];
            
            label.textColor=[UIColor hexFloatColor:@"6F5536"];
            UILabel*line=[[UILabel alloc]initWithFrame:CGRectMake(label.frame.origin.x, label.frame.origin.y+label.frame.size.height, detailSize.width, 1)
                          ];
            line.backgroundColor=[UIColor hexFloatColor:@"6F5536"];
            [self.view addSubview:line];
        }
        
        else if (i==2)
        {
            label.text=@"服务邮箱：service@vanvalt.com";
            CGSize detailSize =[label.text sizeWithFont:[UIFont systemFontOfSize:16] constrainedToSize:CGSizeMake(MAXFLOAT, MAXFLOAT) lineBreakMode:UILineBreakModeWordWrap];
            label.textColor=[UIColor blueColor];
            UILabel*line=[[UILabel alloc]initWithFrame:CGRectMake(label.frame.origin.x, label.frame.origin.y+label.frame.size.height, detailSize.width, 1)];
            line.backgroundColor=[UIColor blueColor];
            [self.view addSubview:line];
        }
        else{
            label.text=@"官方网站：http://www.dde-edu.com";
        }
        [self.view addSubview:label];
    }
    
//    UILabel*bigLabel=[[UILabel alloc]init];
//    bigLabel.center=CGPointMake(ScreenWidth/2, ScreenHeight-40);
//    bigLabel.bounds=CGRectMake(0, 0, ScreenWidth, 25);
//    bigLabel.text=@"Copyright ©2015 丹鼎教育 版权所有";
//    bigLabel.textAlignment=1;
//    bigLabel.font=[UIFont systemFontOfSize:19];
//    [self.view addSubview:bigLabel];
}
-(void)backButtonClick
{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
